/*
 * Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * https://github.com/Bilibili/jni4android
 * This file is automatically generated by jni4android, do not modify.
 */

#include "AudioRendererInfo.h"


typedef struct J4AC_ohos_media_audio_AudioRendererInfo__Builder {
    jclass id;

    jmethodID constructor_Builder;
    jmethodID method_audioStreamInfo;
    jmethodID method_bufferSizeInBytes;
    jmethodID method_isOffload;
    jmethodID method_audioStreamOutputFlag;
    jmethodID method_distributedDeviceId;
    jmethodID method_build;
} J4AC_ohos_media_audio_AudioRendererInfo__Builder;
static J4AC_ohos_media_audio_AudioRendererInfo__Builder class_J4AC_ohos_media_audio_AudioRendererInfo__Builder;

typedef struct J4AC_ohos_media_audio_AudioRendererInfo {
    jclass id;

} J4AC_ohos_media_audio_AudioRendererInfo;
static J4AC_ohos_media_audio_AudioRendererInfo class_J4AC_ohos_media_audio_AudioRendererInfo;

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__Builder(JNIEnv *env)
{
    return (*env)->NewObject(env, class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.id, class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.constructor_Builder);
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__Builder__catchAll(JNIEnv *env)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__Builder(env);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__Builder__asGlobalRef__catchAll(JNIEnv *env)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__Builder__catchAll(env);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__audioStreamInfo(JNIEnv *env, jobject thiz, jobject audioStreamInfo)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_audioStreamInfo, audioStreamInfo);
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__audioStreamInfo__catchAll(JNIEnv *env, jobject thiz, jobject audioStreamInfo)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__audioStreamInfo(env, thiz, audioStreamInfo);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__audioStreamInfo__asGlobalRef__catchAll(JNIEnv *env, jobject thiz, jobject audioStreamInfo)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__audioStreamInfo__catchAll(env, thiz, audioStreamInfo);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__bufferSizeInBytes(JNIEnv *env, jobject thiz, jlong bufferSizeInBytes)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_bufferSizeInBytes, bufferSizeInBytes);
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__bufferSizeInBytes__catchAll(JNIEnv *env, jobject thiz, jlong bufferSizeInBytes)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__bufferSizeInBytes(env, thiz, bufferSizeInBytes);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__bufferSizeInBytes__asGlobalRef__catchAll(JNIEnv *env, jobject thiz, jlong bufferSizeInBytes)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__bufferSizeInBytes__catchAll(env, thiz, bufferSizeInBytes);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__isOffload(JNIEnv *env, jobject thiz, jboolean isOffload)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_isOffload, isOffload);
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__isOffload__catchAll(JNIEnv *env, jobject thiz, jboolean isOffload)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__isOffload(env, thiz, isOffload);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__isOffload__asGlobalRef__catchAll(JNIEnv *env, jobject thiz, jboolean isOffload)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__isOffload__catchAll(env, thiz, isOffload);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__audioStreamOutputFlag(JNIEnv *env, jobject thiz, jobject outputFlag)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_audioStreamOutputFlag, outputFlag);
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__audioStreamOutputFlag__catchAll(JNIEnv *env, jobject thiz, jobject outputFlag)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__audioStreamOutputFlag(env, thiz, outputFlag);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__audioStreamOutputFlag__asGlobalRef__catchAll(JNIEnv *env, jobject thiz, jobject outputFlag)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__audioStreamOutputFlag__catchAll(env, thiz, outputFlag);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__distributedDeviceId(JNIEnv *env, jobject thiz, jstring distributedDeviceId)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_distributedDeviceId, distributedDeviceId);
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__distributedDeviceId__catchAll(JNIEnv *env, jobject thiz, jstring distributedDeviceId)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__distributedDeviceId(env, thiz, distributedDeviceId);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__distributedDeviceId__asGlobalRef__catchAll(JNIEnv *env, jobject thiz, jstring distributedDeviceId)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__distributedDeviceId__catchAll(env, thiz, distributedDeviceId);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__distributedDeviceId__withCString(JNIEnv *env, jobject thiz, const char *distributedDeviceId_cstr__)
{
    jobject ret_object = NULL;
    jstring distributedDeviceId = NULL;

    distributedDeviceId = (*env)->NewStringUTF(env, distributedDeviceId_cstr__);
    if (J4A_ExceptionCheck__throwAny(env) || !distributedDeviceId)
        goto fail;

    ret_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__distributedDeviceId(env, thiz, distributedDeviceId);
    if (J4A_ExceptionCheck__throwAny(env) || !ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &distributedDeviceId);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__distributedDeviceId__withCString__catchAll(JNIEnv *env, jobject thiz, const char *distributedDeviceId_cstr__)
{
    jobject ret_object = NULL;
    jstring distributedDeviceId = NULL;

    distributedDeviceId = (*env)->NewStringUTF(env, distributedDeviceId_cstr__);
    if (J4A_ExceptionCheck__catchAll(env) || !distributedDeviceId)
        goto fail;

    ret_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__distributedDeviceId__catchAll(env, thiz, distributedDeviceId);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &distributedDeviceId);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__distributedDeviceId__withCString__asGlobalRef__catchAll(JNIEnv *env, jobject thiz, const char *distributedDeviceId_cstr__)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__distributedDeviceId__withCString__catchAll(env, thiz, distributedDeviceId_cstr__);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__build(JNIEnv *env, jobject thiz)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_build);
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__build__catchAll(JNIEnv *env, jobject thiz)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__build(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRendererInfo__Builder__build__asGlobalRef__catchAll(JNIEnv *env, jobject thiz)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRendererInfo__Builder__build__catchAll(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

int J4A_loadClass__J4AC_ohos_media_audio_AudioRendererInfo__Builder(JNIEnv *env)
{
    int         ret                   = -1;
    const char *J4A_UNUSED(name)      = NULL;
    const char *J4A_UNUSED(sign)      = NULL;
    jclass      J4A_UNUSED(class_id)  = NULL;
    int         J4A_UNUSED(api_level) = 0;

    if (class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.id != NULL)
        return 0;

    sign = "ohos/media/audio/AudioRendererInfo$Builder";
    class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.id = J4A_FindClass__asGlobalRef__catchAll(env, sign);
    if (class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.id == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.id;
    name     = "<init>";
    sign     = "()V";
    class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.constructor_Builder = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.constructor_Builder == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.id;
    name     = "audioStreamInfo";
    sign     = "(Lohos/media/audio/AudioStreamInfo;)Lohos/media/audio/AudioRendererInfo$Builder;";
    class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_audioStreamInfo = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_audioStreamInfo == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.id;
    name     = "bufferSizeInBytes";
    sign     = "(J)Lohos/media/audio/AudioRendererInfo$Builder;";
    class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_bufferSizeInBytes = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_bufferSizeInBytes == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.id;
    name     = "isOffload";
    sign     = "(Z)Lohos/media/audio/AudioRendererInfo$Builder;";
    class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_isOffload = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_isOffload == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.id;
    name     = "audioStreamOutputFlag";
    sign     = "(Lohos/media/audio/AudioRendererInfo$AudioStreamOutputFlag;)Lohos/media/audio/AudioRendererInfo$Builder;";
    class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_audioStreamOutputFlag = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_audioStreamOutputFlag == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.id;
    name     = "distributedDeviceId";
    sign     = "(Ljava/lang/String;)Lohos/media/audio/AudioRendererInfo$Builder;";
    class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_distributedDeviceId = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_distributedDeviceId == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.id;
    name     = "build";
    sign     = "()Lohos/media/audio/AudioRendererInfo;";
    class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_build = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRendererInfo__Builder.method_build == NULL)
        goto fail;

    J4A_ALOGD("J4ALoader: OK: '%s' loaded\n", "ohos.media.audio.AudioRendererInfo$Builder");
    ret = 0;
fail:
    return ret;
}

int J4A_loadClass__J4AC_ohos_media_audio_AudioRendererInfo(JNIEnv *env)
{


    int         ret                   = -1;
    const char *J4A_UNUSED(name)      = NULL;
    const char *J4A_UNUSED(sign)      = NULL;
    jclass      J4A_UNUSED(class_id)  = NULL;
    int         J4A_UNUSED(api_level) = 0;

    if (class_J4AC_ohos_media_audio_AudioRendererInfo.id != NULL)
        return 0;

    sign = "ohos/media/audio/AudioRendererInfo";
    class_J4AC_ohos_media_audio_AudioRendererInfo.id = J4A_FindClass__asGlobalRef__catchAll(env, sign);
    if (class_J4AC_ohos_media_audio_AudioRendererInfo.id == NULL)
        goto fail;

    ret = J4A_loadClass__J4AC_ohos_media_audio_AudioRendererInfo__Builder(env);
    if (ret)
        goto fail;


    J4A_ALOGD("J4ALoader: OK: '%s' loaded\n", "ohos.media.audio.AudioRendererInfo");
    ret = 0;
fail:

    return ret;
}
